/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package estructuras;

import java.util.Comparator;

/**
 *
 * @author asus
 * Clase abstracta para la implementación posterior de heaps
 */
public abstract class AbstractHeap<E extends Comparable<E>> implements Comparator<E> {
    
    public abstract E getFirst();
    
    public abstract E remove();

    public abstract void add(E value);
    
    public boolean isEmpty() {
        return size() == 0;
    }
    
    public abstract int size();
    
    public void clear() {
        for (int i = 0; i < size(); i++) {
            remove();
        }
    }
    
    public int compare(E o1, E o2) {
        return o1.compareTo(o2);
    }
   
    
}
